package com.xiangyun.xyojbackendjudgeservice.codesandbox;


import com.xiangyun.xyojbackendmodel.codesandbox.ExecuteRequest;
import com.xiangyun.xyojbackendmodel.codesandbox.ExecuteResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CodeSandBoxProxy implements CodeSandBox {

    private final CodeSandBox codeSandBox;

    public CodeSandBoxProxy(CodeSandBox codeSandBox) {
        this.codeSandBox = codeSandBox;
    }

    @Override
    public ExecuteResponse executeCode(ExecuteRequest executeRequest) {
        log.info("代码沙箱请求信息：{}", executeRequest.toString());
        //执行对应的代码沙箱
        ExecuteResponse executeResponse = codeSandBox.executeCode(executeRequest);
        log.info("代码沙箱响应信息：{}", executeResponse.toString());
        return executeResponse;
    }

}
